//
// Created by Vinson Cai on 2021/7/21.
//

#ifndef USBDISPLAYCLIENTSDK_DEFAULTUSBDISPLAYCLIENTSETTING_H
#define USBDISPLAYCLIENTSDK_DEFAULTUSBDISPLAYCLIENTSETTING_H

#include <string.h>
#include <stdint.h>
#include "USBDisplayClientSDK.h"


static void defaultOnStartConnectingToReceiver(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnConnectedReceiverSuccess(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnDisconectFromReceiver(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;

}

static void defaultOnConnectToReceiverReady(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnRequestStartShareScreenSuccess(const void *cls, const char *ip, int frameRate, UsbDisplayClientResolution resolution, int gop, int bitrate) {
    (void) cls;
    (void) ip;
    (void) frameRate;
    (void) resolution;
}

static void defaultOnRequestStartShareScreenFailed(const void *cls, const char *ip, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) ip;
    (void) code;
}

static void defaultOnRequestStopShareScreenSuccess(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnRequestStopShareScreenFailed(const void *cls, const char *ip, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) ip;
    (void) code;
}

static void defaultOnRequestStartMirrorBackSuccess(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnRequestStartMirrorBackFailed(const void *cls, const char *ip, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) ip;
    (void) code;
}

static void defaultOnRequestStopMirrorBackSuccess(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnRequestStopMirrorBackFailed(const void *cls, const char *ip, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) ip;
    (void) code;
}

static void defaultOnServerRequestStartShareScreen(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnServerRequestStopShareScreen(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnSeverRequestStartMirrorBack(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnServerRequestStopMirrorBack(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnReceiverTouchBack(const void *cls, const char *ip, int count, UsbDisplayTouchEvent *events) {
    (void) cls;
    (void) ip;
    (void) count;
    (void) events;
}

static void defaultOnReceiverMirrorBackVideoFrame(const void *cls, const char *ip, const uint8_t *buf, int length, int timestamp) {
    (void) cls;
    (void) ip;
    (void) buf;
    (void) length;
    (void) timestamp;
}

static void defaultOnReceivedMirrorBackVideoInfo(const void* cls, const char* ip, int format, int resolution, int fps) {
    (void) cls;
    (void) ip;
    (void) format;
    (void) resolution;
    (void) fps;
}

static void defaultOnReceivedMirrorBackAudioFrame(const void *cls, const char *ip, const uint8_t *buf, int length, int timestamp) {
    (void) cls;
    (void) ip;
    (void) buf;
    (void) length;
    (void) timestamp;
}

static void defaultOnReceivedMirrorBackAudioInfo(const void* cls, const char* ip, int format, int sampleRate, int channelCount) {
    (void) cls;
    (void) ip;
    (void) format;
    (void) sampleRate;
    (void) channelCount;
}

static void defaultOnLostReceiverConnection(const void *cls, const char *ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnServerRequestUpdateFrameRate(const void *cls, const char *ip, int framerate,
                                                  UsbDisplayClientResolution resolution,
                                                  int keyFrameInterval,
                                                  int bitRate,
                                                  UsbDisplayRotationDegree degree,
                                                  UsbDisplayScreenMirror mirror) {
    (void) cls;
    (void) ip;
    (void) framerate;
    (void) resolution;
    (void) keyFrameInterval;
    (void) bitRate;
    (void) degree;
    (void) mirror;
}

static void defaultOnFoundOneReceiver(const void *cls, const char *ip, const char *version, const char *name, const char *localAddress) {
    (void) cls;
    (void) ip;
    (void) version;
    (void) name;
    (void) localAddress;
}

static void defaultOnPinCodeServerResponseReceiverAddress(const void *cls,
                                                          USBDisplayClientSDKErrorCode code,
                                                          const PinCodeReceiverInfo* receiverInfo) {
    (void) cls;
    (void) code;
    (void) receiverInfo;
}

static void defaultOnLogMsg(UsbDisplayClientLogLevel level, const char* msg) {
    (void) level;
    (void) msg;
}


static void defaultOnServerResponseAuthenticatePasswordResult(const void *cls, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) code;
}

static void defaultOnServerResponseAuthenticatePinCodeResult(const void* cls, USBDisplayClientSDKErrorCode code) {
    (void) cls;
    (void) code;
}

static void defaultOnQueryReceiverBy8PinCodeFoundReceiver(const void *cls,
                                                          const char *ip,
                                                          const char *name,
                                                          const char *version,
                                                          const char *localAddress) {
    (void) cls;
    (void) ip;
    (void) version;
    (void) name;
    (void) localAddress;
}

static void defaultOnQueryReceiverBy8PinCodeFoundNone(const void *cls) {
    (void) cls;
}

static void defaultOnQueryReceiverBy5LocalPinCodeFoundReceiver(const void *cls,
                                                          const char *ip,
                                                          const char *name,
                                                          const char *version,
                                                          const char *localAddress) {
    (void) cls;
    (void) ip;
    (void) version;
    (void) name;
    (void) localAddress;
}

static void defaultOnQueryReceiverBy5LocalPinCodeFoundNone(const void *cls) {
    (void) cls;
}

static void defaultOnQueryReceiverBy6LocalPinCodeFoundReceiver(const void *cls,
                                                          const char *ip,
                                                          const char *name,
                                                          const char *version,
                                                          const char *localAddress) {
    (void) cls;
    (void) ip;
    (void) version;
    (void) name;
    (void) localAddress;
}

static void defaultOnQueryReceiverBy6LocalPinCodeFoundNone(const void *cls) {
    (void) cls;
}



static void defaultOnQueryReceiverInfoByIpFoundReceiver(const void *cls,
                                                        const char *ip,
                                                        const char *name,
                                                        const char *version,
                                                        const char *localAddress) {
    (void) cls;
    (void) ip;
    (void) version;
    (void) name;
    (void) localAddress;
}
static void defaultOnQueryReceiverInfoByIpFoundNone(const void *cls, const char* ip) {
    (void) cls;
    (void) ip;
}

static void defaultOnAuthorizeResult(const void *cls, UsbDisplayAuthorizeResult result) {
    (void) cls;
    (void) result;
}

static USBDisplayClientCallback createDefaultCallback(void) {
    USBDisplayClientCallback callback;

    callback.onStartConnectingToReceiver = defaultOnStartConnectingToReceiver;
    callback.onConnectedReceiverSuccess = defaultOnConnectedReceiverSuccess;
    callback.onDisconnectFromReceiver = defaultOnDisconectFromReceiver;
    callback.onConnectToReceiverReady = defaultOnConnectToReceiverReady;
    callback.onLostReceiverConnection = defaultOnLostReceiverConnection;

    callback.onRequestStartShareScreenSuccess = defaultOnRequestStartShareScreenSuccess;
    callback.onRequestStartShareScreenFailed = defaultOnRequestStartShareScreenFailed;
    callback.onRequestStopShareScreenSuccess = defaultOnRequestStopShareScreenSuccess;
    callback.onRequestStopShareScreenFailed = defaultOnRequestStopShareScreenFailed;

    callback.onRequestStartMirrorBackSuccess = defaultOnRequestStartMirrorBackSuccess;
    callback.onRequestStartMirrorBackFailed = defaultOnRequestStartMirrorBackFailed;
    callback.onRequestStopMirrorBackSuccess = defaultOnRequestStopMirrorBackSuccess;
    callback.onRequestStopMirrorBackFailed = defaultOnRequestStopMirrorBackFailed;

    callback.onServerRequestStartShareScreen = defaultOnServerRequestStartShareScreen;
    callback.onServerRequestStopShareScreen = defaultOnServerRequestStopShareScreen;
    callback.onSeverRequestStartMirrorBack = defaultOnSeverRequestStartMirrorBack;
    callback.onServerRequestStopMirrorBack = defaultOnServerRequestStopMirrorBack;

    callback.onReceiverTouchBack = defaultOnReceiverTouchBack;

    callback.onReceiverMirrorBackVideoInfo = defaultOnReceivedMirrorBackVideoInfo;
    callback.onReceiverMirrorBackVideoFrame = defaultOnReceiverMirrorBackVideoFrame;
    callback.onReceivedMirrorBackAudioInfo = defaultOnReceivedMirrorBackAudioInfo;
    callback.onReceivedMirrorBackAudioFrame = defaultOnReceivedMirrorBackAudioFrame;

    callback.onServerRequestUpdateFrameRate = defaultOnServerRequestUpdateFrameRate;

    callback.onFoundOneReceiver = defaultOnFoundOneReceiver;

    callback.onPinCodeServerResponseReceiverAddress = defaultOnPinCodeServerResponseReceiverAddress;
    callback.onServerResponseAuthenticatePasswordResult = defaultOnServerResponseAuthenticatePasswordResult;
    callback.onServerResponseAuthenticatePinCodeResult = defaultOnServerResponseAuthenticatePinCodeResult;

    callback.onQueryReceiverBy8PinCodeFoundNone = defaultOnQueryReceiverBy8PinCodeFoundNone;
    callback.onQueryReceiverBy8PinCodeFoundReceiver = defaultOnQueryReceiverBy8PinCodeFoundReceiver;

    callback.onQueryReceiverInfoByIpFoundReceiver = defaultOnQueryReceiverInfoByIpFoundReceiver;
    callback.onQueryReceiverInfoByIpFoundNone = defaultOnQueryReceiverInfoByIpFoundNone;

    callback.onQueryReceiverBy5LocalPinCodeFoundReceiver = defaultOnQueryReceiverBy5LocalPinCodeFoundReceiver;
    callback.onQueryReceiverBy5LocalPinCodeFoundNone = defaultOnQueryReceiverBy5LocalPinCodeFoundNone;

    callback.onQueryReceiverBy6LocalPinCodeFoundReceiver = defaultOnQueryReceiverBy6LocalPinCodeFoundReceiver;
    callback.onQueryReceiverBy6LocalPinCodeFoundNone = defaultOnQueryReceiverBy6LocalPinCodeFoundNone;

    callback.onAuthorizeResult = defaultOnAuthorizeResult;

    callback.onLogMsg = defaultOnLogMsg;
    return callback;
}

static USBDisplayClientParameter createDefaultUsbDisplayClientParameter(void) {
    USBDisplayClientParameter parameter;
    strcpy(parameter.deviceName, "TailClient");
    memset(parameter.deviceId, 0, sizeof(parameter.deviceId));
    parameter.clientType = USBDISPLAY_CLIENT_TYPE_LINUX_WIFI;
    parameter.callback = createDefaultCallback();
    parameter.logLevel = USBDISPLAY_CLIENT_LOG_ERROR;
    parameter.sdkType = 2;

    return parameter;
}








#endif //USBDISPLAYCLIENTSDK_DEFAULTUSBDISPLAYCLIENTSETTING_H
